//
//  Refresh.m
//  太平洋电脑
//
//  Created by dlios on 15-9-2.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "Refresh.h"
#import "AFNetworking.h"

@implementation Refresh
+ (void)getdataWithString:(NSString *)string block:(AFNData)block
{

    AFNetworkReachabilityManager *netWorkManager = [AFNetworkReachabilityManager sharedManager];
    NSString *url_string = [NSString stringWithFormat:@"%@",string];
    AFHTTPRequestOperationManager* manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain",@"text/json",@"application/json",@"text/javascript",@"text/html",nil];
    NSString *myString = [url_string stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [manager GET:myString parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [netWorkManager stopMonitoring];
        block(responseObject);
      
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

}];
}
@end
